// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package enum

import (
	"fmt"
	"testing"
)

func TestRevisionVerbIsFilled(t *testing.T) {
	for i := 0; i <= int(revisionVerbUnusedEnd); i++ {
		if _, ok := RevisionVerbs[RevisionVerb(i)]; !ok {
			t.Errorf("RevisionVerb[%d] is not filled", i)
		}
	}
}

func TestRevisionVerbIsValid(t *testing.T) {
	for i := 0; i <= int(revisionVerbUnusedEnd); i++ {
		if verb, ok := RevisionVerbs[RevisionVerb(i)]; ok {
			t.Run(fmt.Sprintf("%d-%s", i, verb.EnumKeyName), func(t *testing.T) {
				if verb.Label == "" {
					t.Errorf("Label in %s(%d) is empty", verb.EnumKeyName, i)
				}
				if verb.LabelBackgroundColor == "" {
					t.Errorf("LabelBackgroundColor in %s(%d) is empty", verb.EnumKeyName, i)
				}
				if verb.CSSSelector == "" {
					t.Errorf("CSSSelector in %s(%d) is empty", verb.EnumKeyName, i)
				}
			})
		}
	}
}
